package com.shengzai.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;

public class HdfsDeleteCode {
    public static void main(String[] args) throws IOException {
        Configuration entries = new Configuration();
        entries.set("fs.defaultFS","hdfs://master:9000");
        FileSystem fileSystem = FileSystem.get(entries);
        boolean res = fileSystem.exists(new Path("/input/a.txt"));
        if (res){
            System.out.println("删除成功");
        }else
            System.out.println("删除失败");

    }
}
